const shsDB = require('./../db/index.js');
/*更新积分*/
function upIntegral(userId, Integral) {
	let upsql = `update users set Integral=Integral+${Integral} where Id=${userId}`
	shsDB(upsql).then(data => {
		if (data.affectedRows != 1) {
			// console.log("更新sql出错啦")
			throw new Error()
		}
	}).catch(err => {
		// console.log("积分添加失败", err)
	})
}


module.exports = {
	upIntegral
}